#!/usr/bin/env python
# coding=utf-8

__metaclass__ = type


# @staticmethod表示下面的方法是静态方法
class StaticMethod:
    @staticmethod
    def foo():
        print "This is static method foo()."


# @classmethod表示下面的方法是类方法
class ClassMethod:
    @classmethod
    def bar(cls):
        print "This is class method bar()."
        print "bar() is part of class:", cls.__name__


"""This is python lesson"""


def start_func(arg):
    """This is a function."""
    pass


class MyClass:
    """Thi is my class."""

    def my_method(self, arg):
        """This is my method."""
        pass


if __name__ == "__main__":
    static_foo = StaticMethod()  # 实例化
    static_foo.foo()  # 实例调用静态方法
    StaticMethod.foo()  # 通过类来调用静态方法
    print "********"
    class_bar = ClassMethod()
    class_bar.bar()
    ClassMethod.bar()
